<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<div class="t_bar">
	<span class="color_red">*</span>项目基本情况
</div>
<table class="t_css" width="100%" border="0" cellpadding="0"
	cellspacing="1" id="pro_info">
	<col style="width: 16%" />
	<col style="width: 34%" />
	<col style="width: 16%" />
	<col style="width: 34%" />


	<tr class="li_1">
		<td align="right">项目名称：</td>
		<td colspan="3"><input type='text' name='proposal/zh_title'
			id='zh_title' style="width: 78.1%"
			class="input_css required maxlength:100" maxlength="100"
			value='<x:out select="$xmlData/data/proposal/zh_title"/>'
			label="项目名称"></td>
			
	</tr>
	<tr>
	<td align="right" nowrap>单位名称：</td>
	<td colspan="3"><span name="organizations/organization/org_name"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" />
		    </span>
	</td>
	</tr>

	<tr class="li_1">
		<td align="right">通讯地址：</td>
		<td colspan="">
			<span name="organizations/organization/address" ><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/address"/> </span>
		</td>
		<td align="right" nowrap colspan="">邮政编码：</td>
		<td colspan="">
			<span name="organizations/organization/zip_code"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/zip_code" /></span>
		</td>
	</tr>

	<tr>
		<td align="right">归口管理部门：</td>
		<td colspan="">
			<c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
			<cpt:tree key="recomend_org_gk" cacheable="false" readonly="true" className="hn_iuput_kuang gray" id="recomend_org" value="${recomend_org}" label="归口管理部门"   showPattern="all" shieldPattern="-1"
					  onClick="initTreeValueExt2" />
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required" value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
			<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>
		<td align="right" >申报日期：</td>
		<td colspan="1"> <c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="apply_date_curr"  name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期" ></cpt:date>
		</td>
	</tr>


	<tr>
		<td align="right">项目类别：</td>
		<td colspan="">
			<span name="proposal/grant_name" ><x:out select="$xmlData/data/proposal/sub_grant_name" /></span>
		</td>
		<td align="right" >行业领域：</td>
		<td colspan="1">
			<%--<c:set var="suoshu_type_value"><x:out select="$xmlData/data/product/industry_type_value" /></c:set>
			<input name="product/industry_type_value" type="hidden"  value="<x:out select="$xmlData/data/product/industry_type_value" />" />
			<input name="product/industry_type_name" type="hidden" class="required" lable="行业领域" value="<x:out select="$xmlData/data/product/industry_type_name" />" />
			<cpt:select id="industry_type" key="domain" onChange="initControlValue('industry_type')" value="${industry_type_value}">
			</cpt:select>
--%>


			<c:set var="industry_type">
				<x:out select="$xmlData/data/proposal/industry_type_value" />
			</c:set>

			<cpt:select id="industry_type" key="domain" name="proposal/industry_type" label="行业领域" value="${industry_type}" className="required"></cpt:select>

			<input type="hidden" id="industry_type_value" name="proposal/industry_type_value"  value="<x:out select="$xmlData/data/proposal/industry_type_value" />" />
			<input type="hidden" name="proposal/industry_type_name" id="industry_type_name" value="<x:out select="$xmlData/data/proposal/industry_type_name" />" />


				<%--<c:set var="command_year">
					<x:out select="$xmlData/data/proposal/command_year_value" />
				</c:set>
				<cpt:select id="command_year" key="statYearAppPrj" name="proposal/command_year" label="命名年度" value="${command_year}" className="required"></cpt:select>
				<input type="hidden" id="command_year_value" name="proposal/command_year_value"  value="<x:out select="$xmlData/data/proposal/command_year_value" />" />
				<input type="hidden" name="proposal/command_year_name" id="command_year_name" value="<x:out select="$xmlData/data/proposal/command_year_name" />" />--%>
		</td>

	</tr>

<tr>

	<td align="right">学科：</td>
	<td colspan=""><span name="proposal/fzr_subject_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/subject_name" /></span></td>

	<td align="right">是否引智成果推广经费：</td>
	<td colspan="">

		<cpt:checkbox key="boolean" name="extension_funds" className="required" value="${extension_funds }" width="100px;"  repeatColumn="3"  tagType="radio" ></cpt:checkbox>
		<input type="hidden" id="extension_funds_value" name="proposal/extension_funds_value"  class="required"
			   value="<x:out select="$xmlData/data/proposal/extension_funds_value" />" label="是否引智成果推广经费">
		<input type="hidden" name="proposal/extension_funds_name" value="<x:out select="$xmlData/data/proposal/extension_funds_name" />">
	</td>
</tr>

	<tr>

		<td align="right">是否有效期内的国家级或省级引智基地：</td>
		<td colspan=""><cpt:checkbox key="boolean" name="international_transfer" className="required" value="${international_transfer }" width="100px;"  repeatColumn="3"  tagType="radio" ></cpt:checkbox>
			<input type="hidden" id="international_transfer_value" name="proposal/international_transfer_value"  class="required"
				   value="<x:out select="$xmlData/data/proposal/international_transfer_value" />" label="是否有效期内的国家级或省级引智基地">
			<input type="hidden" name="proposal/international_transfer_name" value="<x:out select="$xmlData/data/proposal/international_transfer_name" />">
		</td>
		<td align="right">命名年度：</td>
		<td colspan="">

			<c:set var="command_year">
				<x:out select="$xmlData/data/proposal/command_year_value" />
			</c:set>
			<cpt:select id="command_year" key="statYearAppPrj" name="proposal/command_year" label="命名年度" value="${command_year}" className="required"></cpt:select>
			<input type="hidden" id="command_year_value" name="proposal/command_year_value"  value="<x:out select="$xmlData/data/proposal/command_year_value" />" />
			<input type="hidden" name="proposal/command_year_name" id="command_year_name" value="<x:out select="$xmlData/data/proposal/command_year_name" />" />


			<%--<c:set var="stat_year2_value"><x:out select="$xmlData/data/proposal/stat_year2_value" /></c:set>
			<input name="proposal/stat_year2_value" type="hidden" class="required" value="<x:out select="$xmlData/data/proposal/stat_year2_value" />"  lable="命名年度" />
			<input name="proposal/stat_year2_name" type="hidden" value="<x:out select="$xmlData/data/proposal/stat_year2_name" />" />
			<cpt:select id="stat_year2" key="stat_year2" onChange="initControlValue('stat_year2')" value="${stat_year2_value}">
			</cpt:select>--%>
		</td>
	</tr>
	<table class="t_css" width="100%" border="0" cellpadding="0"
		   cellspacing="1" id="pro_info1">
		<col style="width: 16%" />
		<col style="width: 21%" />
		<col style="width: 21%" />
		<col style="width: 21%" />
		<col style="width: 21%" />

		<tr >

			<td align="right" rowspan="2">项目负责人：</td>
			<td align="right">姓名：</td>
			<td>
				<span name="proposal/fzr_psnname"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/></span>
			</td>
			<td align="right">职务/职称：</td>
			<td >
				<span name="proposal/fzr_position"><x:out select="$xmlData/data/organization_persons/person[@sequence_no='1']/position"/></span>/
				<span name="proposal/fzr_prof_title_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name"/></span>
			</td>
		</tr>
		<tr>
			<td align="right">电子邮箱：</td>
			<td>
				<span name="proposal/fzr_email"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/></span>
			</td>
			<td align="right">联系电话：</td>
			<td><span name="proposal/fzr_tel"><x:out
					select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /></span>
			</td>
		</tr>
		<tr >

			<td align="right" rowspan="2">项目联系人：</td>

			<td align="right">姓名：</td>
			<td>
				<input  name="proposal/contact_psn_cname" label="姓名" type="text"  class="input_css required"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />"/>
			</td>
			<td align="right">职务/职称：</td>
			<td >
				<input  name="proposal/contact_psn_prof_title_name" label="职务/职称" type="text"  class="input_css required"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_prof_title_name" />"/>
			</td>
		</tr>
		<tr>
			<td align="right" >电子邮箱：</td>
			<td >
				<input name="proposal/contact_psn_email" label="电子邮箱" type="text"  maxlength="50"  class="input_css required email"  value="<x:out select="$xmlData/data/proposal/contact_psn_email" />"/>
			</td>
			<td align="right">联系电话：</td>
			<td >
				<input name="proposal/contact_psn_tel_work" label="联系电话" type="text"    class="input_css required "  value="<x:out select="$xmlData/data/proposal/contact_psn_tel_work" />"/>
			</td>
		</tr>
	</table>




<script type="text/javascript">
	$(function() {
		showAllDateTag("pro_info");
		addlevel();
		InitMoney();
		/* 临时办法去除所属学科的属性以及加上要的*/
		/* $("#subject").removeClass();
		$("#subject").removeAttr("disabled");
		$("#subject").attr("readonly","readonly"); */
	});

	function InitMoney(){
		var grant_code= $("#grantCode").val();
		var total_each_0 = $("#request_money").html();

		if(grant_code == 4759){
			if(total_each_0 == 0){
				$("#request_money").html("0.00");
			}
		}
		/* if(grant_code == 4757){
            if(total_each_0 == 0){
                $("#total_each_0").val(parseFloat(10.00).toFixed(2));
                $("#total_fund_18").val(parseFloat(10.00).toFixed(2));
                $("#total_investfrom_5").val(parseFloat(10.00).toFixed(2));
            }
        } */
	}
	/* 用来显示等级-职称 */
	function addlevel(){
		var level = $("#level_no").val();
		var prof_title_name = $("#prof_title_name").val();
		var string1 = "未取得";
		var string2 = "高级-";
		var string3 = "副高级-";
		var string4 = "中级-";
		var string5 = "初级-";
		if(level.length<=0 || level ==""){
			$("#prof_title").html(string1);
		}else if(level==1){
			$("#prof_title").html(string2+prof_title_name);
		}else if(level==2){
			$("#prof_title").html(string3+prof_title_name);
		}else if(level==3){
			$("#prof_title").html(string4+prof_title_name);
		}else if(level==4){
			$("#prof_title").html(string5+prof_title_name);
		}
	}
	function initTreeValueExt(treeId, treeNode) {
		if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
			scmWarn($("#" + treeId).attr("label")
					+ messageTip.researchAreaInvalidDisciplineCode);
			if (treeNode.level == 0) {
				$("#" + treeId).val("");
				$("#" + treeId).parents("td").find(
						"[name$='" + treeId + "_code'],[id$='" + treeId
								+ "_code']").val("");
				$("#" + treeId).parents("td").find(
						"[name$='" + treeId + "_value'],[id$='" + treeId
								+ "_value']").val("");
				$("#" + treeId).parents("td").find(
						"[name$='" + treeId + "_name'],[id$='" + treeId
								+ "_name']").val("");
			}

			return false;
		}

		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			obj = obj.parentNode;
		}

		$("#" + treeId).parents("td").find(
				"[name$='" + treeId + "_code'],[id$='" + treeId + "_code']")
				.val(treeNode.id);
		$("#" + treeId).parents("td").find(
				"[name$='" + treeId + "_value'],[id$='" + treeId + "_value']")
				.val(treeNode.id);
		$("#" + treeId).parents("td").find(
				"[name$='" + treeId + "_name'],[id$='" + treeId + "_name']")
				.val(str);

	}
	
	function initTreeValueExt2(treeId, treeNode) {
		if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
			scmWarn($("#" + treeId).attr("label")
					+ messageTip.researchAreaInvalidDisciplineCode);
			if (treeNode.level == 0) {
				$("#" + treeId).val("");
				$("#" + treeId).parents("td").find(
						"[name$='" + treeId + "_code'],[id$='" + treeId
								+ "_code']").val("");
				$("#" + treeId).parents("td").find(
						"[name$='" + treeId + "_value'],[id$='" + treeId
								+ "_value']").val("");
				$("#" + treeId).parents("td").find(
						"[name$='" + treeId + "_name'],[id$='" + treeId
								+ "_name']").val("");
			}

			return false;
		}

		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			obj = obj.parentNode;
		}

		$("#" + treeId).parents("td").find(
				"[name$='" + treeId + "_code'],[id$='" + treeId + "_code']")
				.val(treeNode.id);
		$("#" + treeId).parents("td").find(
				"[name$='" + treeId + "_value'],[id$='" + treeId + "_value']")
				.val(treeNode.id);
		$("#" + treeId).parents("td").find(
				"[name$='" + treeId + "_name'],[id$='" + treeId + "_name']")
				.val(str);

	}


</script>
